Xbasic

ROUND_DOWN Function

Syntax

Result as N = round_down(N number [,N decimal_places ])

Arguments

Result

A version of the number truncated to Decimal_Places decimal places.

number

The original number.

decimal_places

The number of decimal places to keep.

Description

Rounds a number down to the specified number of decimal places

Discussion

The ROUND_DOWN() function rounds a number down to the specified number of decimal places.

Example

? round_down(pi) 
= 3 
? round_down(pi,1) 
= 3.1 
? round_down(pi,2) 
= 3.14 
? round_down(pi,3) 
= 3.141 
? round_down(pi,4) 
= 3.1415 
? round_down(pi,5) 
= 3.14159

See Also